﻿@model LiteBlog.Models.TitleModel

@{
    this.ViewBag.Title = Model.Title + " - " + Model.Tagline;
}

@if (!Model.IsSite)
{
    <text>
        <div id="back-menu">
            <a href="/">Back to @Model.Site</a>
        </div>
    </text>
}

<div id="headerTitle" class="float-left">
    @if (ViewBag.UseImage)
    {
        <text><img height="40" src="@Url.Content(ViewBag.ImageUrl)" /></text>
    }
    <span class="title-text">@Html.Raw(Model.Title)</span>
    <span class="tagline-text">@Html.Raw(Model.Tagline)</span>
</div>
<div id="headerMenu" class="float-right">
    <ul>
        <li>@this.Html.ActionLink("Home", "Index", "Home") </li>
        <li>@this.Html.ActionLink("Admin", "Index", "Admin") </li>
        @foreach (var page in Model.Pages)
        {
            <li>@this.Html.ActionLink(page.Title, "Index", "Page", new { id = page.FileId }, null)</li>
        }
    </ul>
</div>
<div id="headerStrip">
    @foreach (var kvp in Model.Skins)
    {
        var skinColor = kvp.Value;
        if (skinColor != Model.Skin)
        {
            <div class="skin-box" skin-color="@kvp.Key" style="background-color: rgb(@skinColor.R, @skinColor.G, @skinColor.B)">&nbsp;</div>
        }
        else
        {
            <div class="skin-box-selected" style="background-color: rgb(@skinColor.R, @skinColor.G, @skinColor.B)">&nbsp;</div>
        }
    }
    <div style="clear: both;"></div>
</div>

<script type="text/javascript">
    $(function () {
        if($('title').text()==='')
            $('title').text('@ViewBag.Title');
    });
</script>
